package com.FangFaYingYong.A01FangFaYingYong;

import java.util.ArrayList;
import java.util.Collections;

public class Test02 {
    public static void main(String[] args) {
        /*
        * 创建集合添加学生对象，学神对象属性 name,age
        *  只获取姓名并梵高数组当中
        * */

        ArrayList<C04_Student> list = new ArrayList<>();
        Collections.addAll(list, new C04_Student("张三", 18), new C04_Student("李四", 20), new C04_Student("王五", 19));

        String[] array = list.stream().map(C04_Student::getName).toArray(String[]::new);
    }
}
